home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLSRC.PAK / PRINTOUT.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.1 KB  |  153 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1992, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.4  $
  6. //
  7. //----------------------------------------------------------------------------
  8. #pragma hdrignore SECTION
  9. #include <owl/pch.h>
  10. #if !defined(OWL_PRINTER_H)
  11. # include <owl/printer.h>
  12. #endif
  13.  
  14. OWL_DIAGINFO;
  15.  
  16. #if !defined(SECTION) || SECTION == 1
  17.  
  18. //
  19. //
  20. //
  21. TPrintout::TPrintout(const char far* title)
  22. :
  23.   Title(strnewdup(title)),
  24.   Banding(false),
  25.   ForceAllBands(true),
  26.   DC(0),
  27.   PageSize(0)
  28. {
  29. }
  30.  
  31. //
  32. //
  33. //
  34. TPrintout::~TPrintout()
  35. {
  36.   delete[] Title;
  37. }
  38.  
  39. //
  40. //
  41. //
  42. void
  43. TPrintout::SetPrintParams(TPrintDC* dc, TSize pageSize)
  44. {
  45.   SetPrintDC(dc);
  46.   SetPageSize(pageSize);
  47. }
  48.  
  49. //
  50. //
  51. //
  52. void
  53. TPrintout::GetDialogInfo(int& minPage, int& maxPage,
  54.                          int& selFromPage, int& selToPage)
  55. {
  56.   minPage = 1;
  57.   maxPage = INT_MAX;
  58.   selFromPage = selToPage = 0;
  59. }
  60.  
  61. //
  62. //
  63. //
  64. void
  65. TPrintout::BeginPrinting()
  66. {
  67. }
  68.  
  69. //
  70. //
  71. //
  72. void
  73. TPrintout::BeginDocument(int, int, unsigned)
  74. {
  75. }
  76.  
  77. //
  78. //
  79. //
  80. bool
  81. TPrintout::HasPage(int page)
  82. {
  83.   return page == 1;
  84. }
  85.  
  86. //
  87. //
  88. //
  89. void
  90. TPrintout::PrintPage(int, TRect&, unsigned)
  91. {
  92. }
  93.  
  94. //
  95. //
  96. //
  97. void
  98. TPrintout::EndDocument()
  99. {
  100. }
  101.  
  102. //
  103. //
  104. //
  105. void
  106. TPrintout::EndPrinting()
  107. {
  108. }
  109.  
  110. //
  111. // Set a new title for this printout. The passed title string is copied.
  112. //
  113. void
  114. TPrintout::SetTitle(const char far* title)
  115. {
  116.   delete[] Title;
  117.   Title = strnewdup(title);
  118. }
  119.  
  120. #endif
  121. #if !defined(SECTION) || SECTION == 2
  122.  
  123. IMPLEMENT_STREAMABLE(TPrintout);
  124.  
  125. #if !defined(BI_NO_OBJ_STREAMING)
  126.  
  127. //
  128. //
  129. //
  130. void*
  131. TPrintout::Streamer::Read(ipstream& is, uint32) const
  132. {
  133.   GetObject()->Title = is.freadString();
  134.   is >> GetObject()->Banding;
  135.   is >> GetObject()->ForceAllBands;
  136.   return GetObject();
  137. }
  138.  
  139. //
  140. //
  141. //
  142. void
  143. TPrintout::Streamer::Write(opstream& os) const
  144. {
  145.   os.fwriteString(GetObject()->Title);
  146.   os << GetObject()->Banding;
  147.   os << GetObject()->ForceAllBands;
  148. }
  149.  
  150. #endif  // if !defined(BI_NO_OBJ_STREAMING)
  151.  
  152. #endif
  153.